
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Feign接口有哪些参数？ - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>Feign接口有哪些参数？ - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在Feign调用中，支持哪些常见的参数传递方式？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">支持三种方式：a) 地址传值，例如 info/10； b) 问号后面传值，例如 ?id=10； c) 直接传递对象，此时底层会将对象转换为JSON字符串进行传递。</div>
          </div>
          <div class="card-source">来源: 1、feign调用过程中参数的传递的方式</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">在定义Feign接口时，对方法的形参绑定有什么强制性要求？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在Feign接口上进行参数传递时，必须要使用注解（如 @RequestParam）把方法的形参进行绑定。</div>
          </div>
          <div class="card-source">来源: 1、feign调用过程中参数的传递的方式</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">在`@FeignClient`注解中，`name`和`value`参数有何关系与作用？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`value`参数是`name`参数的别名，它们的作用是相同的，都用于指定Feign客户端的名称，这个名称通常用于标识目标服务。</div>
          </div>
          <div class="card-source">来源: `name`参数 / `value`参数</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">如果不想通过服务发现而是直接连接到某个具体服务实例，应该使用`@FeignClient`的哪个参数？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">应该使用`url`参数。它用于指定服务的URL地址，可以直接指定服务的物理位置，常用于测试时的直连调用。</div>
          </div>
          <div class="card-source">来源: `url`参数</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模式</div>
          <div class="card-question">如何通过`@FeignClient`注解为服务调用配置降级逻辑？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模式</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">可以使用`fallback`参数，指定一个服务降级处理类。当服务调用失败时，系统会执行该降级类中定义的逻辑。</div>
          </div>
          <div class="card-source">来源: `fallback`参数</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">`@FeignClient`注解中的`path`参数有什么作用？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`path`参数用于指定一个服务的基础路径（或称为命名空间），它会作为URL的前缀，用于构建最终的请求地址。</div>
          </div>
          <div class="card-source">来源: `path`参数</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">`@FeignClient`注解中的`primary`参数是做什么用的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`primary`参数用于指定当前Feign客户端是否作为主要的Bean。当存在依赖注入冲突时，这个参数可以帮助Spring容器确定优先选择哪个Bean。</div>
          </div>
          <div class="card-source">来源: `primary`参数</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">如何为特定的Feign客户端指定一个自定义的配置类来覆盖默认行为？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">可以使用`@FeignClient`注解的`configuration`参数，将自定义的Feign配置类（例如`CustomFeignConfiguration.class`）赋值给它，从而配置该客户端的行为。</div>
          </div>
          <div class="card-source">来源: `configuration`参数</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">`@FeignClient`注解的`decode404`参数如何影响Feign对HTTP 404状态码的处理？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`decode404`参数用于决定Feign如何处理404状态码。如果设置为`true`，Feign会将404错误视为正常的响应，而不会抛出异常。</div>
          </div>
          <div class="card-source">来源: `decode404`参数</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
